package br.edu.fanor.esfinge.dao.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import br.edu.fanor.esfinge.dao.AreaEstudoDao;
import br.edu.fanor.esfinge.entity.AreaEstudo;

@Stateless(mappedName="ejb/AreaEstudoDao")
public class AreaEstudoDAOImpl implements AreaEstudoDao{
	
	@PersistenceContext
	private EntityManager em;
	
	@Override
	public AreaEstudo inserir(AreaEstudo areaEstudo) {
		em.persist(areaEstudo);
		return areaEstudo;
	}

	@Override
	public AreaEstudo buscarPorId(Long id) {
		
		return em.find(AreaEstudo.class, id);
	}

	@Override
	public void remover(AreaEstudo areaEstudo) {
		em.remove(areaEstudo);
	}

}
